﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Teamwish.Domain.Common;
using Teamwish.Webapi.Models;

namespace Teamwish.Webapi.Controllers
{
    public class TokenController : ApiController
    {
        [AllowAnonymous]
        public SeverMsg GetToken(string code)
        {
            string token = TokenHelper.GenToken(new TokenInfo() {
                
                UserName="Admin",UserRole="管理员",iss="Admin"
            });
            return new SeverMsg() { status=1,data= token };           
        }

        [AllowAnonymous]
        public SeverMsg GetToken2(string code)
        {
            string token = TokenHelper.GenToken(new TokenInfo()
            {
                UserName = "Admin",
                UserRole = "市场",
                iss = "Admin"
            });
            return new SeverMsg() { status = 1, data = token };
        }
    }
}
